#ifndef LAN2DATETIMEEDIT_H
#define LAN2DATETIMEEDIT_H

#include "lan2calcombine.h"

#include <QCalendarWidget>
#include <QDateTimeEdit>
#include <QMainWindow>
#include <QObject>
#include "lan2core.h"
LAN2STA
class Lan2DateTimeEdit : public QDateTimeEdit
{
    Q_OBJECT
public:
    Lan2DateTimeEdit(QWidget *parent = nullptr,int offsetx=0,int offsety=0,int width=360,int cal_height=270,int head_height=50,int time_height=40,int control_height=40,int line_height=1);
//    QCalendarWidget* mcalendar=nullptr;
    Lan2CalCombine* mlcc=nullptr;
    void method_moveCombineCal(int mx,int my);
    const int mi_movey=70;

    void method_update(int mx,int my);
    void method_delmlcc();
    void method_delAllTimePlanes();
    void method_hidemlcc();
    void method_showmlcc();
    QString method_getTxt() const;
    QWidget* mainwindow=nullptr;

private:
    int mh_head=0;
    int mh_cal=0;
    int mh_time=0;
    int mh_control=0;
    int mh_line=1;

    int moffsetx=0;
    int moffsety=0;


    // QObject interface
public slots:
    void slot_combinetoday();
    void slot_combineok(QDateTime);
    void slot_combineclear();

    // QWidget interface
protected:
//    void mousePressEvent(QMouseEvent *event);

    // QObject interface
public:
    bool eventFilter(QObject *watched, QEvent *event);

    // QWidget interface


    // QWidget interface
protected:
    void moveEvent(QMoveEvent *event);
};

LAN2END
#endif // LAN2DATETIMEEDIT_H
